package com.timing.finder.framework;

import com.timing.finder.util.ProtoStuffUtil;

/**
 * @author JingGe(* ^ ▽ ^ *)
 * @date 2023-03-06 14:49
 * @email 1158055613@qq.com
 */
public class ProtoStuffSerializerAndDeserializer implements CacheStoreSerializer<byte[]>, CacheStoreDeserializer<byte[]> {

    @Override
    public <T extends CacheData> byte[] serialize(T data) {
        return ProtoStuffUtil.serialize(data);
    }

    @Override
    public <T extends CacheData> T deserialize(byte[] source, Class<T> type) {
        return ProtoStuffUtil.deserialize(source, type);
    }
}
